Initial compiler PR#1
Merged
Merged
Conversation
jamesadevine
added a commit
that referenced
this pull request
May 8, 2026
Two findings + three suggestions from the latest Rust PR Reviewer pass:
1. Stage-3 typed-deserialize errors after codemods reused the same
"Failed to parse YAML front matter" context as the Stage-1 raw
parse, so a codemod that produced an invalid shape was
indistinguishable from a user typo. Switch to with_context that
surfaces the applied codemod ids when codemods ran:
"Failed to parse YAML front matter after applying codemods (id1, id2);
a codemod likely produced an invalid shape".
2. rename_key with ConflictPolicy::PreferNew returns Ok(true) when
it drops a stale `old` key even though `new` is unchanged. That
triggers a source-rewrite warning saying "we migrated" when
really we "cleaned up a remnant". The behavior is correct (the
mapping did mutate); the doc was misleading. Rewrote the
rename_key doc comment to enumerate exactly when Ok(true) fires
and call out the PreferNew/cleanup case.
3. Added `// TODO(codemods): remove when the first real codemod is
registered.` markers next to every #[allow(dead_code)] /
#[allow(unused_imports)] in src/compile/codemods/{mod,helpers}.rs
so search-based cleanup is trivial when the registry stops being
empty.
4. tests/codemod_tests.rs leaked temp dirs on assertion failure
because `let _ = fs::remove_dir_all(&dir)` only ran on the happy
path. Refactored to return tempfile::TempDir from the helpers
and rely on RAII cleanup, matching the pattern already used by
src/compile/codemod_integration_test.rs.
Skipped: the empty-mapping concern in reconstruct_source (a
mapping reduced to empty wouldn't deserialize as FrontMatter
anyway because of required name/description fields, so the
existing typed-deserialize error path catches it; #1 makes that
error informative).
All 1349 tests pass.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add ADO compiler and set up actions to run.